package com.bajiao.notify.controller.order;

import com.ijpay.core.kit.WxPayKit;
import com.bajiao.common.exception.DataHandleException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: 退款记录表
 * @Author: zb-admin
 * @Date: 2024-10-1004-24
 * @Version: V1.0
 */
@Slf4j
@RestController
@RequestMapping("/order/refundRecord")
public class RefundRecordController {


    /**
     * 微信退款通知
     */
    @RequestMapping(value = "/wxPay/refundNotify", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    public String refundNotify(HttpServletRequest request) {
        Map<String, String> result = new HashMap<String, String>(2);
        try {

        } catch (DataHandleException d) {
            result.put("return_code", "FAIL");
            result.put("return_msg", d.getMessage());
            return WxPayKit.toXml(result);
        }
        result.put("return_code", "SUCCESS");
        result.put("return_msg", "OK");
        return WxPayKit.toXml(result);
    }
}
